package courselection;
import java.util.Scanner;
import java.io.*;

public class User extends People {
    public static void main(String[] args) {
        // 创建学生对象
        Student mf = new Student(001, "张木凡", "男","大数据" ,null);
        Student zy = new Student(002, "李泽言", "女", "计算机",null);
        // 创建课程对象
        Course course = new Course(001, "Java应用与技术", "教学楼103", "周三第3、4节");
        Course c1 =new Course(002, "线性代数", "主楼2202", "周一第1、2节");
        Course c2 = new Course(003, "马克思主义基本原理概论", "教学楼207", "周三第5、6节");
        Course c3 = new Course (004,"离散数学","教学楼207","周五3、4节");
        //创建教师对象
        Teacher teacher = new Teacher(001, "张老师", "男", course);
        Teacher t1 = new Teacher(002, "王老师", "女", c1);
        Teacher t2 = new Teacher(003, "石老师", "男", c2);
        Teacher t3 = new Teacher(004,"方老师","女",c3);
        //学生选课
        mf.setSelectCourse(course);
        zy.setSelectCourse(c1);
        //输出学生信息
        System.out.println(mf);
        System.out.println(zy);
        //输出教师信息
        System.out.println(teacher);
        System.out.println(t1);
        
        try {
            PrintWriter pw = new PrintWriter(new FileWriter("D:\\北石化\\大二\\JAVA\\实验五\\zzppyy.txt"));
                    pw.print("————————————————————选课信息————————————————————");
        			pw.print(mf);
        			pw.print(zy);
        			pw.print(teacher);
        			pw.print(t1);
        			pw.close();
        		}
        catch (IOException student) {
        			student.printStackTrace();
        		}
        }
 		
}
